package com.zuimei.zuimei.activities;

import android.os.Bundle;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;
import com.zuimei.zuimei.R;
import com.zuimei.zuimei.base.BaseActivity;
import com.zuimei.zuimei.beans.EveryDBean;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by pc on 2017/1/18.
 */
public class EveryXQingActivity extends BaseActivity {
    @Bind(R.id.iv_edxq_top)
    ImageView ivEdxqTop;
    @Bind(R.id.iv_edxq_back)
    ImageView ivEdxqBack;
    @Bind(R.id.iv_edxq_sm)
    ImageView ivEdxqSm;
    @Bind(R.id.bt_edxq_fav)
    Button btEdxqFav;
    @Bind(R.id.bt_edxq_share)
    Button btEdxqShare;
    @Bind(R.id.bt_edxq_down)
    Button btEdxqDown;
    @Bind(R.id.tv_edxq_content)
    TextView tvEdxqContent;
    @Bind(R.id.web_edxq)
    WebView webEdxq;
    @Bind(R.id.tv_edxq_title)
    TextView tvEdxqTitle;
    @Bind(R.id.tv_edxq_sub)
    TextView tvEdxqSub;

    @Override
    public int getLayoutId() {
        return R.layout.everydxqingactivity_layout;
    }

    @Override
    protected void init() {
        super.init();
        EveryDBean.DataBean.AppsBean bean = (EveryDBean.DataBean.AppsBean) getIntent().getSerializableExtra("bean");
        tvEdxqTitle.setText(bean.getTitle());
        tvEdxqSub.setText(bean.getSub_title());
        tvEdxqContent.setText(bean.getDigest());
        Picasso.with(this).load(bean.getCover_image()).into(ivEdxqTop);
        Picasso.with(this).load(bean.getIcon_image()).into(ivEdxqSm);

        webEdxq.loadDataWithBaseURL(null,bean.getContent(),"text/html","utf-8",null);
    }



}
